import { pubRequire } from '@utils/public'
const baseUrl = '/banner'
// 获取列表
export function getBannerList(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callBack, errBack)
}
// 新增banner
export function addBanner(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
// 按照id查询banner
export function getBannerDetail(id, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`, '', callBack, errBack)
}
// 编辑banner
export function editBanner(id, obj, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callBack, errBack)
}
// 删除banner
export function delBanner(id, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callBack, errBack)
}
// 关闭banner
export function closeBanner(id, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/close`, '', callBack, errBack)
}
// 打开banner
export function openBanner(id, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/open`, '', callBack, errBack)
}
// 按照分组Id查询分组信息
export function groupDetail(ids, callBack, errBack) {
  return pubRequire('get', `/user-group/detail/${ids}`, '', callBack, errBack)
}
